import time
import pytest
from selenium import webdriver
from page import Page

@pytest.fixture(scope='function')
def driver():
    driver = webdriver.Edge()
    driver.maximize_window()
    yield driver
    driver.close()
    driver.quit()

def test_week(driver):
    po = Page(driver)
    po.url('https://www.so.com/')
    po.input()
    po.goto_loc()
    po.dy_loc()
    print(po.dy_loc())
    assert "我在做软件测试" in po.dy_loc()
    po.execute()
    time.sleep(9)
    po.two_loc()
    po.dy2_loc()
    print(po.dy2_loc())
    assert "我在做软件测试" in po.dy2_loc()